<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>字符串char循环右移n位</title>
</head>
<body>
    <script>
        function rightChange (char,n) {
            var arr = char.split("");
            for (i = 1 ; i <= n ; i++) {
                arr.unshift(arr.pop())
            }
            return arr.join("")
        }
        console.log(rightChange('abcdefg',3))
    </script>
</body>
</html>